The invention relates generally to power conservation in electronic devices, and relates particularly to power conservation in a keyboard encoder.
Extraordinary amounts of attention have been paid to the goal of reducing power consumption in consumer devices including personal computers. There are two general motivations for this. First, it is considered important in today's society to reduce the consumption of fossil fuels, and reducing power consumption in personal computers furthers that goal. Second, the present consumer marketplace rewards those who find ways to make computers small and light in weight, and who find ways to make it possible for the computers to run for a long time without the requirement of connection to household electrical current.
The general categories of techniques used for reducing power consumption in personal computers are by now very well known to even the most casual user of a laptop, notebook, or sub-notebook personal computer. One category is to reduce the power consumption of the various high-power-demand building blocks, such as the hard disk drive, the floppy disk drive, static memory, the display, and the central processing unit. Another category is to switch the high-power-demand building blocks on and off at particular times. Another quite distinct category is to provide high-power and low-power modes in those building blocks, and to switch them between modes at particular times. If the decision is made to design a computer so that its subsystems will switch between operational modes from time to time, then a subcategory of the design process is to specify what the determining factors will be (e.g. how long since the last user keystroke, or how long since the last disk access) and what action will be taken (e.g. power down the hard disk thirty seconds after the last disk access).
In the process of squeezing every wasted milliwatt out of the computer system, there comes a time when all the parts of the system other than the keyboard have been squeezed as much as possible and the only part remaining is the keyboard.
One of the highly standardized interfaces in modern personal computers is the interface between the keyboard and the computer (here often called "the system"). The interface is defined on several hardware and software levels. The hardware-level interface definition includes a wire count (power, clock, data, and ground) and signal levels for those wires. Protocols are well recognized for synchronous (clock-mediated) serial transmission bidirectionally between the keyboard and the computer. According to the PS/2 protocol, for example, any communication from the computer ("the system") to the keyboard is annunciated first by asserting (in this context, dropping the voltage level of) the clock line, followed by lowering the data line in order to assert the first bit which is always zero. The keyboard, following the protocol, prepares to receive a byte from the computer. The byte is communicated to the keyboard as serial data clocked by transitions on the clock line, the clock transitions provided by the keyboard.
As is well known to those familiar with keyboards of personal computers, the majority of communications between the computer and the keyboard is in the direction from the keyboard to the computer. Such communication most often the result of a user typing on the keyboard, and is carried on the clock and data lines just discussed. Other communications from the keyboard to the computer are the result of responding to commands from the computer. Still other communications from the keyboard to the computer are part of the power-on initialization and diagnosis sequence.
Communications from the computer to the keyboard are relatively infrequent and are used to communicate, for example, that the status LEDs (shift lock, scroll lock, and nums lock) should be turned on or off.
One of the decisions in the design of a keyboard is the selection of the entity that will mediate between the keys and the computer ("the system"). Historically a common choice is to use two microcontrollers for this purpose. By "microcontroller" is meant an integrated circuit containing a microprocessor, RAM, ROM, and I/O circuitry. One microcontroller is located within the keyboard and the other is located within the computer, and the two microcontrollers are linked with a serial bus. As a matter of convention, the microcontroller that is in the computer is called a "controller" and the microcontroller that is in the keyboard is called an "encoder". In more recent years the functionality of the controller in the computer has been absorbed into an application-specific integrated circuit (ASIC) that serves many functions in addition to mediating between the keyboard serial bus and the rest of the computer.
Within the keyboard, the keys are disposed in a matrix with rows and columns. The encoder monitors the rows and columns to detect key closures and releases. Among the non-trivial design demands are that the encoder perform switch contact debouncing and resolve n-key rollover conditions and "phantom" keys resulting from instances when more than one key has been pressed. The encoder must interpret each event, such as a key closure or release, into a standardized datum called a scancode for transmission to the computer. The typical encoder employed is an eight-bit microcontroller with RAM, ROM, I/O ports to receive all the matrix lines, and serial lines serving the communications channel to the computer. The encoder microcontroller is often selected from or compatible with the Intel 8042 or 8031 microcontroller families, and is often chosen to be CMOS for lower power consumption. Within the computer the controller is often an 8042 microcontroller or an equivalent functionality within an ASIC.
The effort to reduce power consumption in the keyboard thus focuses on the encoder. As is well known to those skilled in the art, the power consumption in CMOS microcontrollers devices bears a strong linear relation to the clock speed at which the microcontroller is being operated (which, it will be appreciated, has little or no relation to the clock rate of the synchronous serial channel between the keyboard and the computer). Thus, one strategy for reducing power consumption in the keyboard encoder is to reduce its clock speed. Those skilled in the art will appreciate, however, that there are tradeoffs in this approach. Slowing down the clock speed of the encoder means that the encoder cannot provide so many services in a given period of time. This sets a natural lower limit on how much the clock speed of the encoder can be reduced.
It is also known in the art, as a general approach, to have the keyboard encoder enter a state in which it consumes very low power, at times when there is no need for the encoder to be functioning. For example the encoder is generally required to respond to only two stimuli--the pressing of a key or the attempt by the computer to send a message to the keyboard. Thus, in prior art encoders, an energy-saving approach is for the encoder to keep track of how long it has been since a key has been pressed, and to keep track of how long it has been since a message has been received from the computer. If some predetermined period of time passes, then the encoder can enter its very-low-power state. This is typically a "halt" state which results in virtually no activity in the encoder, and virtually no power consumption. The design of the encoder is such that there is an interrupt pin, assertion of which causes the encoder to "wake" up and to begin execution of an interrupt service routine. But it typically requires a large parts count for all the events that would trigger waking up to be able to do so.
It should also be appreciated, however, that there are many potential difficulties in switching between the normal and very-low-power (also called "sleep") states. The most critical task is not to determine when to go to sleep, although many prior art designs devote much attention to the timing of when to go to sleep. The most critical task is how to leave the "sleep" state, that is, how to "wake up". This is because when the microcontroller "sleeps", its functionality is usually limited and requires some certain amount of time, often termed a "latency period", to wake up. In order not to miss any real-time events, such as keystrokes and commands from the system, special precautions are needed. Implementing the "wake up" feature is a very complicated job.
It is desirable to have a keyboard in which a relatively small parts count suffices to permit wakeup events to trigger waking up. It is also desirable to avoid or minimize nuisance wakeups: wakeups that occur even though it was not really necessary to wake up.